// templates/deliver/pages/order/order.js
const app = getApp();
Page({

    /**
     * 页面的初始数据
     */
    data: {
        name:'',
        orderAll:[],
        view_delivery_man_id: 0,
        view_driver_name: '',
        view_delivery_district_id: 0
    },

    /**
     * 生命周期函数--监听页面加载
     */
    //根据订单id查询对应的订单信息
 async  onLoad(options) {
        let view_delivery_man_id = wx.getStorageSync('view_delivery_man_id') || 0
        let view_driver_name = ''
        let view_delivery_district_id = 0
        if (view_delivery_man_id > 0) {
            view_driver_name = wx.getStorageSync('view_driver_name')
            view_delivery_district_id = wx.getStorageSync('view_delivery_district_id')
        }

        this.setData({
            view_delivery_man_id,
            view_driver_name,
            view_delivery_district_id
        })

        var order_id = options.order_id;
        var _this = this;
        wx.p.request({
            url: app.globalData.URL + '/deliver.Order/getByidOrderAll',
            method:'GET',
            data:{
                order_id: order_id,
            },
            
            success(res){
                console.log(res)
                _this.setData({
                    name: options.name,
                    orderAll: res.data.data.data.orderDetailAll
                })
            }
        })

    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})